import request from '@/config/axios'

// 物理传感器 VO
export interface PhysicalSensorVO {
  id: number // ID
  sensorId: string // 传感器ID
  sensorType: string // 传感器类型
  outputSignalType: string // 输出信号类型
  sensorSerialNumber: string // 传感器序列号
  sensorParams: string // 传感器参数
  sensorConfig: string // 传感器配置
  sensorSpecs: string // 传感器规格
  remark: string // 备注
  terminalDeviceId: string // 终端设备ID
}

// 物理传感器 API
export const PhysicalSensorApi = {
  // 查询物理传感器分页
  getPhysicalSensorPage: async (params: any) => {
    return await request.get({ url: `/vmiot/physical-sensor/page`, params })
  },

  // 查询物理传感器详情
  getPhysicalSensor: async (id: number) => {
    return await request.get({ url: `/vmiot/physical-sensor/get?id=` + id })
  },

  // 新增物理传感器
  createPhysicalSensor: async (data: PhysicalSensorVO) => {
    return await request.post({ url: `/vmiot/physical-sensor/create`, data })
  },

  // 修改物理传感器
  updatePhysicalSensor: async (data: PhysicalSensorVO) => {
    return await request.put({ url: `/vmiot/physical-sensor/update`, data })
  },

  // 删除物理传感器
  deletePhysicalSensor: async (id: number) => {
    return await request.delete({ url: `/vmiot/physical-sensor/delete?id=` + id })
  },

  // 导出物理传感器 Excel
  exportPhysicalSensor: async (params) => {
    return await request.download({ url: `/vmiot/physical-sensor/export-excel`, params })
  }
}
